# 作者：小七
# 2024年12月30日

# 1
def print_info(name, title="", gender=True):
    gender_text = "男生"
    if not gender:
        gender_text = "女生"
    print("%s%s 是 %s" % (title, name, gender_text))


print_info("小明")
print_info("老王", title="班长")
print_info("小美", gender=False)
print_info("小王", gender=False, title='学生')


# 2

def demo(num, *args, **kwargs):
    print(num)
    print(args)
    print(kwargs)
    print("-" * 50)
    demo2(*args, **kwargs)
    demo2(args, kwargs)


def demo2(*args, **kwargs):
    print(args)
    print(kwargs)


demo(1, 2, 3, 4, 5, name="小七", age=18)


# 3
class Dog:
    def __init__(self, name, color):
        self.name = name
        self.color = color

    def bark(self):
        print("汪汪叫")

    def shake(self):
        print("摇尾巴")


dahuang = Dog("大黄", "黄色")
print(dahuang.name, dahuang.color)
dahuang.bark()
dahuang.shake()
